
export const instanceTypeChoice = [
  { value: '2u', label: '2u', disabled: false },
  { value: '4u', label: '4u', disabled: false },
  { value: 'ibm', label: 'ibm', disabled: false }
]

export const instanceColumns = _this => [
  {
    title: '主机名称',
    key: 'host',
    sortable: true,
    render: (h, { row }) => {
      return <router-link to={'/rds/instance/' + row.id} style='color: #2d8cf0'>{row.host}</router-link>
    }
  },
  {
    title: '所属集群',
    key: 'cluster',
    sortable: true,
    render: (h, { row }) => {
      return <router-link to={'/rds/cluster/' + row.cluster.id} style='color: #2d8cf0'>{row.cluster.name}</router-link>
    }
  },
  {
    title: 'IP地址',
    key: 'ip',
    width: 150,
    sortable: true,
    render: (h, { row }) => {
      return <span>{row.ip}</span>
    }
  },
  {
    title: '类型',
    key: 'type',
    width: 80,
    sortable: true,
    render: (h, { row }) => {
      return <span>{row.type}</span>
    }
  },
  {
    title: 'SSH端口',
    key: 'ssh_port',
    sortable: true,
    render: (h, { row }) => {
      return <span>{row.sshPort}</span>
    }
  },
  {
    title: 'SSH用户名',
    key: 'ssh_user',
    sortable: true,
    render: (h, { row }) => {
      return <span>{row.sshUser}</span>
    }
  },
  {
    title: 'SSH密码',
    key: 'ssh_password',
    sortable: true,
    render: (h, { row }) => {
      return <span>{row.sshPassword}</span>
    }
  },

  {
    title: 'Charset',
    key: 'charset',
    sortable: true,
    render: (h, { row }) => {
      return <span>{row.charset}</span>
    }
  },
  {
    title: '软件安装位置',
    key: 'location',
    sortable: true,
    render: (h, { row }) => {
      return <span>{row.location}</span>
    }
  },
  {
    title: '创建时间',
    key: 'create_time',
    sortable: true,
    render: (h, { row }) => {
      return <span>{row.createTime}</span>
    }
  },
  {
    title: '更新时间',
    key: 'update_time',
    sortable: true,
    render: (h, { row }) => {
      return <span>{row.updateTime}</span>
    }
  },
  {
    title: '操作',
    key: 'operate',
    width: 120,
    render: (h, { row }) => {
      return <div>
        <el-tooltip className='item' effect='dark' content='修改' placement='top-end'>
          <el-link
            underline={false}
            vOn:click={() => {
              _this.showInstanceActionModal = true
              _this.instanceInfo = row
              _this.action.type = 'update'
              _this.action.title = '更新'
            }} size='small' type='primary'>修改
          </el-link>
        </el-tooltip>
        <el-divider direction='vertical' />
        <el-tooltip className='item' effect='dark' content='删除' placement='top-end'>
          <el-link
            underline={false}
            vOn:click={() => {
              _this.showInstanceDeleteModal = true
              _this.instanceInfo = row
            }} size='small' style='font-size:13px;' type='danger'>删除
          </el-link>
        </el-tooltip>
      </div>
    }
  }
]
